package com.jiuyue.movehouse.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * <p>
 * 
 * </p>
 *
 * @author yourFather
 * @since 2022-02-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Car implements Serializable {

    private static final long serialVersionUID = 1L;

    @Null(groups = Save.class)
    @NotNull(groups = Update.class)
      @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 车牌号
     */
    @NotEmpty(message = "车牌号不能为空",groups = {Save.class,Update.class})
    private String carNumber;

    /**
     * 汽车类型
     */
    @NotNull(message = "汽车类型不能为空",groups = {Save.class,Update.class})
    private Long carTypeId;

    @TableField(exist = false)
    private String carTypeName;

    /**
     * 1:使用中 0:未使用
     */
    private Integer state;

    /**
     * 逻辑删除
     */
    @TableLogic
    private Long deleted;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 创建时间
     */
    private Date createTime;

    public @interface Save{}
    public @interface Update{}


}
